package com.buymobile.dao;


import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;

import com.buymobile.components.page.Page;
import com.ibatis.sqlmap.client.event.RowHandler;

public interface SqlMapDao {
	
	public Page queryForPage(final String statementName, final Object parameterObject,
			final int pageIndex, final int pageSize);

	public Object queryForObject(String statementName)
			throws DataAccessException ;

	public Object queryForObject(final String statementName,
			final Object parameterObject) throws DataAccessException ;

	public Object queryForObject(final String statementName,
			final Object parameterObject, final Object resultObject)
			throws DataAccessException ;

	public List<?> queryForList(String statementName)
			throws DataAccessException ;

	public List<?> queryForList(final String statementName,
			final Object parameterObject) throws DataAccessException ;

	public List<?> queryForList(String statementName, int skipResults,
			int maxResults) throws DataAccessException ;

	public List<?> queryForList(final String statementName,
			final Object parameterObject, final int skipResults,
			final int maxResults) throws DataAccessException ;

	public void queryWithRowHandler(String statementName, RowHandler rowHandler)
			throws DataAccessException ;

	public void queryWithRowHandler(final String statementName,
			final Object parameterObject, final RowHandler rowHandler)
			throws DataAccessException ;

	public Map<?, ?> queryForMap(final String statementName,
			final Object parameterObject, final String keyProperty)
			throws DataAccessException ;
	public Map<?, ?> queryForMap(final String statementName,
			final Object parameterObject, final String keyProperty,
			final String valueProperty) throws DataAccessException ;

	public Object insert(String statementName) throws DataAccessException ;
	public Object insert(final String statementName,
			final Object parameterObject) throws DataAccessException ;

	public int update(String statementName) throws DataAccessException ;

	public int update(final String statementName, final Object parameterObject)
			throws DataAccessException ;
	
	public void update(String statementName, Object parameterObject,
			int requiredRowsAffected) throws DataAccessException ;

	public int delete(String statementName) throws DataAccessException ;

	public int delete(final String statementName, final Object parameterObject)
			throws DataAccessException ;

	public void delete(String statementName, Object parameterObject,
			int requiredRowsAffected) throws DataAccessException;
}
